home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / OOFILE / Buildable, limited OOFILE / OOFILE headers / oof1.inl < prev    next >
Encoding:
Text File  |  1995-09-27  |  6.0 KB  |  376 lines  |  [TEXT/CWIE]

  1. // COPYRIGHT 1994 A.D. Software, All rights reserved
  2.  
  3. // public layer of OOFILE database
  4.  
  5. // inline definitions
  6.  
  7.  
  8. // -------------------------------------------------------
  9. //                      d b C o n n e c t
  10. // -------------------------------------------------------
  11.  inline bool dbConnect::underConstruction()
  12. {
  13.     return sCurrentlyConstructing!=0;
  14. }
  15.  
  16.  
  17.  
  18. // -------------------------------------------------------
  19. //                      d b T a b l e
  20. // -------------------------------------------------------
  21. #if 0
  22. inline dbTable::operator dbTable*() 
  23.     return this; 
  24. };
  25. #endif
  26.  
  27. inline long dbTable::sequenceNumber() const
  28. {
  29.     return mBackend->sequenceNumber();
  30. }
  31.  
  32.  
  33. inline void dbTable::buildSchema() 
  34. {
  35.     mBackend->buildSchema();
  36. }
  37.  
  38.  
  39. inline unsigned int dbTable::numIndexes() const
  40. {
  41.     return mBackend->numIndexes();
  42. }
  43.  
  44.  
  45. inline unsigned int dbTable::numFiles() const
  46. {
  47.     return mBackend->numFiles();
  48. }
  49.  
  50.  
  51. inline void dbTable::createTableInConnection(const dbConnect* theDB) 
  52. {
  53.     mBackend->createTableInConnection(theDB);
  54. }
  55.  
  56.  
  57. inline void dbTable::openTableInConnection(const dbConnect* theDB) 
  58. {
  59.     mBackend->openTableInConnection(theDB);
  60. }
  61.  
  62.  
  63. inline void dbTable::start() 
  64. {
  65.     ContextChange();
  66.     mBackend->start();
  67. }
  68.  
  69.  
  70. inline bool dbTable::more() const
  71. {
  72.     return mBackend->more();
  73. }
  74.  
  75.  
  76. inline bool dbTable::atFirst() const
  77. {
  78.     return mBackend->atFirst();
  79. }
  80.  
  81.  
  82. inline bool dbTable::atLast() const
  83. {
  84.     return mBackend->atLast();
  85. }
  86.  
  87.  
  88. inline void dbTable::next() 
  89. {
  90.     ContextChange();
  91.     mBackend->next();
  92. }
  93.  
  94.  
  95. inline void dbTable::first()
  96. {
  97.     ContextChange();
  98.     mBackend->gotoRelativeRecord(0);
  99. }
  100.  
  101.  
  102. inline void dbTable::prev()
  103. {
  104.     ContextChange();
  105.     mBackend->prev();
  106. }
  107.  
  108.  
  109. inline void dbTable::last()
  110. {
  111.     ContextChange();
  112.     mBackend->gotoRelativeRecord(mBackend->count()-1);
  113. }
  114.  
  115.  
  116. inline unsigned long dbTable::count() const
  117. {
  118.     return mBackend->count();
  119. }
  120.  
  121.  
  122. inline unsigned long dbTable::countAll() const
  123. {
  124.     return mBackend->countAll();
  125. }
  126.  
  127.  
  128. inline bool dbTable::contextChangedFrom(const OOF_Context* ctx) const
  129. {
  130.     return mBackend->contextChangedFrom(ctx);
  131. }
  132.  
  133.  
  134. inline OOF_Context* dbTable::createContext() const
  135. {
  136.     return mBackend->createContext();
  137. }
  138.  
  139.  
  140. inline void dbTable::returnToContext(OOF_Context* ctx)
  141. {
  142.     mBackend->returnToContext(ctx);
  143. }
  144.  
  145.  
  146. inline void dbTable::updateContext(OOF_Context* ctx) const
  147. {
  148.     mBackend->updateContext(ctx);
  149. }
  150.  
  151.  
  152. inline bool dbTable::gotoRelativeRecord(unsigned long relativeNum)
  153. {
  154.     ContextChange();
  155.     return mBackend->gotoRelativeRecord(relativeNum);
  156. }
  157.  
  158.  
  159. inline bool dbTable::gotoRecord(unsigned long relativeNum)
  160. {
  161.     ContextChange();
  162.     return mBackend->gotoRecord(relativeNum);
  163. }
  164.  
  165.  
  166. inline unsigned long dbTable::recordNumber() const
  167. {
  168.     return mBackend->recordNumber();
  169. }
  170.  
  171.  
  172. inline bool dbTable::searchDefaultIndex(const char* defaultIndexSearchStr)
  173. {
  174.     return mBackend->searchEqual((dbField*) mFields[mSortByFieldNum], defaultIndexSearchStr);  // safe downcast
  175. }
  176.  
  177.  
  178. inline bool dbTable::search(const dbQueryClause& query)
  179. {
  180.     return mBackend->search(&query);
  181. }
  182.  
  183.  
  184. inline bool dbTable::searchSelection(const dbQueryClause& query)
  185. {
  186.     return mBackend->searchSelection(&query);
  187. }
  188.     
  189.  
  190. inline void dbTable::difference_with(const dbTable& rhs)
  191. {
  192.     mBackend->difference_with(rhs.mBackend);
  193. }
  194.     
  195.  
  196. inline void dbTable::operator-=(const dbTable& rhs)
  197. {
  198.     mBackend->difference_with(rhs.mBackend);
  199. }
  200.     
  201.  
  202. inline void dbTable::operator%=(const dbTable& rhs)
  203. {
  204.     mBackend->difference_with(rhs.mBackend);
  205. }
  206.  
  207.  
  208.  inline void dbTable:: intersection_with(const dbTable& rhs)  
  209. {
  210.     mBackend->intersection_with(rhs.mBackend);
  211. }
  212.  
  213.  
  214.  inline void dbTable:: operator&=(const dbTable& rhs)  
  215. {
  216.     mBackend->intersection_with(rhs.mBackend);
  217. }
  218.  
  219.  
  220. inline void dbTable::invert()
  221. {
  222.     mBackend->invert();
  223.  
  224.  
  225. inline void dbTable::operator!()
  226. {
  227.     mBackend->invert();
  228.  
  229.  
  230. inline void dbTable::operator~()
  231. {
  232.     mBackend->invert();
  233.  
  234.  
  235. inline void dbTable::union_with(const dbTable& rhs)
  236. {
  237.     mBackend->union_with(rhs.mBackend);
  238. }
  239.  
  240.  
  241. inline void dbTable::operator+=(const dbTable& rhs)
  242. {
  243.     mBackend->union_with(rhs.mBackend);
  244. }
  245.  
  246.  
  247. inline void dbTable::operator|=(const dbTable& rhs)
  248. {
  249.     mBackend->union_with(rhs.mBackend);
  250. }
  251.  
  252.  
  253.  
  254. inline void dbTable::selectAll()
  255. {
  256.     mBackend->selectAll();
  257. }
  258.  
  259.  
  260. inline void dbTable::selectNone()
  261. {
  262.     mBackend->selectNone();
  263. }
  264.  
  265.  
  266. inline bool dbTable::isRecordLoaded() const
  267. {
  268.     return mBackend->isRecordLoaded();
  269. }
  270.  
  271.  
  272. inline bool dbTable::isDirty() const
  273. {
  274.     return mBackend->isDirty();
  275. }
  276.  
  277.  
  278. inline dbField *dbTable::field(fieldNumT fieldNum)
  279.     return (dbField *) mFields[fieldNum]; 
  280. }
  281.  
  282.  
  283. inline dbField *dbTable::field(const char *fieldName)
  284.     return  (dbField *) mFields[fieldName]; 
  285. }
  286.  
  287.  
  288. inline OOF_String dbTable::tableName() const
  289.     return  mTableName; 
  290. }
  291.  
  292.  
  293. inline void dbTable::setName(const char* name)
  294.     mTableName = name; 
  295.     mBackend->mTableName = name; 
  296. }
  297.  
  298.  
  299. inline void dbTable::setOIDfield(const dbField &oidfield) const
  300.     mBackend->setOIDfield(oidfield);
  301. }
  302.  
  303.  
  304. //inline bool dbTable::contextChangedFrom(const OOF_Context* ctx) const
  305. //{
  306. //    return mBackend->contextChangedFrom(ctx);
  307. //}
  308.  
  309.  
  310. //inline void dbTable::updateContext(OOF_Context* ctx) const
  311. //{
  312. //    mBackend->updateContext(ctx);
  313. //}
  314.  
  315.  
  316. //inline OOF_Context* dbTable::createContext() const
  317. //{
  318. //    return mBackend->createContext();
  319. //}
  320.  
  321.  
  322.  
  323. inline void dbTable::setSaveOption(const saveOptions opt)
  324. {
  325.     mSaveOption = opt;
  326. }
  327.  
  328.  
  329. inline void dbTable::sortBy(const dbField* fld)
  330. {
  331.     sortBy(*fld);
  332. }
  333.  
  334.  
  335. // -------------------------------------------------------
  336. //           O O F _ t a b l e  B a c k e n d 
  337. // -------------------------------------------------------
  338. inline void OOF_tableBackend::markDirty()
  339. {
  340.         mDirty=true;
  341. }
  342.  
  343.  
  344. // -------------------------------------------------------
  345. //              O O F _ S t r i n g
  346. // -------------------------------------------------------
  347. inline ostream& operator<<(ostream& os, OOF_String& str)
  348. {
  349.     os << (char *) str;
  350.     return os;
  351. }
  352.  
  353.  
  354. inline bool OOF_String::isEmpty() const
  355. {
  356.     return mBody==0 || mLen==0;
  357. }
  358.  
  359.  
  360. // -------------------------------------------------------
  361. //      O O F _ m i x R e l C h a i n E n d P o i n t
  362. // -------------------------------------------------------
  363. inline bool OOF_mixRelChainEndPoint::hasTransitoryLinks()
  364. {
  365.     return sTransitoryRelChainLinks!=0;
  366. }
  367.